package lesson11

object Test {

  def writeSql(name:String,tableName:String): Unit ={
    val sql="select * from "+tableName+" where name= '"+name+"'"

    val sql1=s"select * from ${tableName} where name = '${name}'"

    val sql2=s"select * from $tableName where name='$name'"


    val sql3=
      s"""
        select
             *
         from
            ${tableName}
         where
             name='${name}'
      """

    println(sql)
    println(sql1)
    println(sql2)
    println(sql3)
  }

  def main(args: Array[String]): Unit = {
    writeSql("user","zhangsan")

  }

}
